/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Modele;

import java.sql.SQLException;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author sio
 */
public class Pays {
    private Collection <Dep> lesDeps;
    private Collection <Spe> lesSpe;
    
    public Pays () {
        lesDeps = DAO.getLesDeps();
        lesSpe = DAO.getLesSpe();
    }
    
    public Collection <Dep> GetLesDeps() {
        return this.lesDeps;
    }
    
    public Dep getLeDep (String numDep) {
        for (Dep unDep : this.lesDeps) {
            if (unDep.getNum().equals(numDep)) {
                return unDep;
            }
           
        }
        return null;
    }
    
    public Collection <Spe> GetLesSpe() {
        return this.lesSpe;
    }
    
    public Spe getLaSpe (String nomSpe) {
        for (Spe uneSpe : this.lesSpe) {
            if (uneSpe.getNomSpe().equals(nomSpe)) {
                return uneSpe;
            }
        }
        return null;
    }
    
}
